#include <QApplication>
#include <QDesktopWidget>
#include "qmlapplicationviewer.h"
#include <QDeclarativeEngine>
#include <QDeclarativeContext>
#include <qdeclarative.h>
#include "SystemUtils.h"

Q_DECL_EXPORT int main(int argc, char *argv[])
{
    QScopedPointer<QApplication> app(createApplication(argc, argv));

    SystemUtils *sysUtils = new SystemUtils;

    QmlApplicationViewer viewer;
    viewer.engine()->rootContext()->setContextProperty("sysUtils", sysUtils);
    viewer.setResizeMode(QDeclarativeView::SizeRootObjectToView);
    viewer.addImportPath(QLatin1String("modules"));
    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
    viewer.setMainQmlFile(QLatin1String("qml/sDesktop/main.qml"));
    if(QApplication::desktop()->width() <= 800)
        viewer.showFullScreen();
    else
        viewer.showExpanded();
    QRect rc = viewer.geometry();
    rc.setSize(QSize(800, 480));
    viewer.setGeometry(rc);

    return app->exec();
}
